package com.finance.controller;

import com.finance.api.ApplyForLoanRestControllerApi;
import com.finance.loan.ApplyForLoan;
import com.finance.service.Impl.LoanServiceImpl;
import com.finance.service.LoanService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author ChenHm
 * @Date 2021/5/19 11:35
 */
@RestController
@CrossOrigin
@RequestMapping("/loan")
public class LoanController implements ApplyForLoanRestControllerApi{


    @Resource
    private LoanServiceImpl loanService;


    /**
     * 申请贷款
     * @param applyForLoan 要添加的申请贷款
     */
    @PostMapping("/apply")
    @Override
    public void applyForLoan(@RequestBody ApplyForLoan applyForLoan) throws Exception {
        loanService.applyForLoan(applyForLoan);
    }



}
